/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rpt.bd.cenario;

import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;

/**
 *
 * @author Roberto
 */
public class CTabPainelBd extends JTabbedPane {

    public CTabPainelBd() {
        super();
        addChangeListener(new javax.swing.event.ChangeListener() {

            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                eventoStateChanged(evt);
            }
        });
    }

    public void eventoStateChanged(final ChangeEvent evt) {
        Object o = evt.getSource();
        if (o instanceof JTabbedPane) {
            final JTabbedPane tp = (JTabbedPane) o;
            final int i = tp.getSelectedIndex();
            o = tp.getComponentAt(i);
            if (o instanceof CDialogoBdCenarioEdicao) {
                CDialogoBdCenarioEdicao d1 = (CDialogoBdCenarioEdicao) o;
                o = d1.getDialogoGradeBdFormBd();
                if (o instanceof CDialogoGradeBdFormBd) {
                    CDialogoGradeBdFormBd d = (CDialogoGradeBdFormBd) o;
                    d.preparar();
                }
            }
        }
    }

    public void add(final CPainelBd aPainelBd) {
    }
}
